//package com.power.sifa.runner.jobs;
//
//import cn.hutool.core.collection.CollUtil;
//import cn.hutool.core.util.ObjectUtil;
//import com.aventrix.jnanoid.jnanoid.NanoIdUtils;
//import com.plf.common.cache.redis.RedisCacheUtil;
//import com.plf.common.utils.SpringHolder;
//import com.power.sifa.base.model.Mq_logerr;
//import com.power.sifa.base.service.Mq_logerrService;
//import com.power.sifa.correction.model.Cre_record_ga;
//import com.power.sifa.correction.model.enumeration.St_deal;
//import com.power.sifa.correction.model.pageInfo.Cre_record_gaPageInfo;
//import com.power.sifa.correction.service.Cre_record_gaService;
//import com.xxl.job.core.biz.model.ReturnT;
//import com.xxl.job.core.handler.annotation.XxlJob;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.data.domain.Page;
//import org.springframework.stereotype.Component;
//
//import java.util.Date;
//import java.util.List;
//
//
//@Slf4j
//@Component
//public class WarningJob {
//
//    public static final String MQNAME = "mq_group_warningthread";
//
//    private RedisCacheUtil redisCacheUtil;
//
//    private Mq_logerrService mq_logerrService;
//
//    private Cre_record_gaService cre_record_gaService;
//
//
//    @XxlJob("warningHandler")
//    public ReturnT<String> warningHandler() {
//        //线程类无法Autowire注入对象，全都要手工getBean初始化
//        redisCacheUtil = SpringHolder.getBean(RedisCacheUtil.class);
//        mq_logerrService = SpringHolder.getBean(Mq_logerrService.class);
//        cre_record_gaService = SpringHolder.getBean(Cre_record_gaService.class);
//
//        log.info("信息查询...");
//        // 查询对应的案件内容
//        Cre_record_gaPageInfo pageInfo = new Cre_record_gaPageInfo();
//        pageInfo.setPageNumber(1);
//        pageInfo.setPageSize(200);
//        pageInfo.setF_status(St_deal.NO);
//        Page<Cre_record_ga> record_gasPage = this.cre_record_gaService.findAll(pageInfo);
//        if (ObjectUtil.isNotNull(record_gasPage) && CollUtil.isNotEmpty(record_gasPage.getContent())) {
//            List<Cre_record_ga> record_gas = record_gasPage.getContent();
//            try {
//                log.info("WarningJob 当前执行的数据大小{}。", record_gas.size());
//                this.cre_record_gaService.transRuleRequests(record_gas);
//                Mq_logerr err = new Mq_logerr();
//                err.setId(NanoIdUtils.randomNanoId());
//                err.setMqname(MQNAME);
//                err.setExectime(new Date());
//                err.setErrormsg("sucess");
//                mq_logerrService.save(err);
//                log.info("WarningJob 执行成功");
//                return ReturnT.SUCCESS;
//            } catch (Exception ex) {
//                //失败日志入库
//                log.error("WarningJob 执行异常:{}", ex.getMessage());
//                Mq_logerr err = new Mq_logerr();
//                err.setId(NanoIdUtils.randomNanoId());
//                err.setMqname(MQNAME);
//                err.setExectime(new Date());
//                err.setErrormsg(ex.getMessage());
//                mq_logerrService.save(err);
//                return ReturnT.FAIL;
//            }
//        }
//        return ReturnT.SUCCESS;
//    }
//
//
//}
